package com.token.sysflow.impl;

import com.token.sql.IntegrateSql;
import com.token.sysflow.core.ReturnPathApprover;
import com.token.sysflow.enumerate.ActionTypeEnum;

/**
 * 获流程的下一环节和办理人
 */
public class GetReturnStepImpl extends AbstractFlowHandlerImpl {

    /**
     * 初始化参数
     *
     * @param iSql 类型
     * @throws Exception 抛出错误
     */
    public void initParameter(IntegrateSql iSql) throws Exception {
        flowCore = new ReturnPathApprover(iSql, keyUnid);
    }

    /**
     * 提交操作类型
     *
     * @return
     */
    public ActionTypeEnum getActionType() {
        return ActionTypeEnum.GETRETRUNPATH;
    }

    /**
     * @throws Exception
     */
    public void handleReturnResult() throws Exception {
        ReturnPathApprover core = (ReturnPathApprover) flowCore;
        this.setReturnJson("data", core.getJsonArray());
        this.setReturnJson("keyUnid",keyUnid);
    }
}